import { defaultRequest as rq } from "./request";
import type { R } from "./request";

/**
 * 获取警告数量
 */
export const alertCountApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/guardcat/server/alert/count", { params });
};

export const alertLineApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/guardcat/server/alert/histogram", { params });
};

export const alertPageApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/guardcat/server/alert/pages", { params });
};

/**
 * 发送测试警告
 */
export const alertTestApi = (data?: object): Promise<R<any>> => {
  return rq.post<R<any>>("${GATEWAY_URL}/backend-bsms/guardcat/server/alert/test", data);
};

export const alertReadApi = (data?: object): Promise<R<any>> => {
  return rq.post<R<any>>("${GATEWAY_URL}/backend-bsms/guardcat/server/alert/read", data);
};
